
*This Stata do-file contains replication materials for "Authoritarianism, Racial Resentment, and Attitudes on the Colin Kaepernick Protests"
*Stata/SE 14.2 was used for all analyses
*Note: We have deleted respondent's personal information and any unused variables for the sake of parsimony. 
*Please contact jeremycastle15@gmail.com with any questions.

use "/Users/jeremycastle/Desktop/Under Review/Kaepernick Project/R&P Submission/Kaepernick R&P Replication/SSI Fall 2018 for SSJ.dta"

***************************************************************************************
***************************************************************************************
*************************STEP 1: RECODES***********************************************
***************************************************************************************
***************************************************************************************

*NOTE: We have included the recodes in the replication file ...
*... so Steps 1 and 2 are just included for reference/transparency.

/*

*keep Q43 Q44 Q78 Q79 Q66 Q71 Q72 Q63 Q64 Q47_1 Q47_2 Q47_3 Q47_4 Q50 Q51 Q52 Q53 Q54 Q76 Q76_13_TEXT Q75 var249

gen kaepfeel = .
replace kaepfeel = Q43 if Q43~=.
replace kaepfeel = Q44 if Q44~=.

gen kaeptreat=.
replace kaeptreat = 0 if Q43~=.
replace kaeptreat = 1 if Q44~=.

gen ideology= (Q78 -1)
gen ideo01 = (ideology/6)
gen party= (Q79 - 1)
gen party01= (party/6)
recode Q66 (1=0) (2=1) (3=.) (4=.) (5=.) (6=.) (7=.), gen(female201)

gen income= (Q71-1)
gen income01= (income/7)
recode Q72 (1=0) (2=1) (3=0) (4=0) (5=0) (6=0) (7=0), gen(hispanic01)
recode Q72 (1=0) (2=0) (3=1) (4=0) (5=0) (6=0) (7=0), gen(black01)
recode Q72 (1=0) (2=0) (3=0) (4=1) (5=1) (6=1) (7=1), gen(raceother01)

gen followpol01 = (Q63 - 1)/2
gen discusspol01 = (Q64 - 1)/4

*symbolic racism scale
recode Q47_1 (1=4) (2=3) (3=2) (4=1) (5=0), gen(workup)
gen workup01 = workup/4
recode Q47_2 (1=0) (2=1) (3=2) (4=3) (5=4), gen(generations)
gen generations01 = generations/4
recode Q47_3 (1=0) (2=1) (3=2) (4=3) (5=4), gen(lessthandeserve)
gen deserve01 = lessthandeserve/4
recode Q47_4 (1=4) (2=3) (3=2) (4=1) (5=0), gen(tryharder)
gen tryharder01 = tryharder/4
egen symracism = rowmean(workup01 generations01 deserve01 tryharder01)
label define symracismlab 0 "lowest sym racism" 1 "high sym racism"
label values symracism symracismlab

*symbolic racism in quartiles (for crosstabs)
gen symracism4cat=.
replace symracism4cat=1 if symracism<.38
replace symracism4cat=2 if symracism>.38 & symracism<.51
replace symracism4cat=3 if symracism>.51 & symracism<.76
replace symracism4cat=4 if symracism>.76

*authoritarianism
recode Q50 (1=0) (2=1), gen(auth1)
recode Q51 (1=1) (2=0), gen(auth2)
recode Q52 (1=0) (2=1), gen(auth3)
recode Q53 (1=0) (2=1), gen(auth4)
recode Q54 (1=1) (2=0), gen(auth5)
gen auth_scale= auth1 + auth2 + auth3 + auth4 + auth5
replace auth_scale=. if auth1==.
replace auth_scale=. if auth2==.
replace auth_scale=. if auth3==.
replace auth_scale=. if auth4==.
replace auth_scale=. if auth5==.
egen auth = rowmean(auth1 auth2 auth3 auth4 auth5)
label define authlab 0 "lowest authoritarianism" 5 "high authoritarianism"
label values auth_scale authlab
gen auth_scale01 = (auth_scale/5)

gen authXtreat = auth_scale01 * kaeptreat
gen symracismXtreat = symracism * kaeptreat

*Coding religion for use in assessing sample demographics
*reltrad 1=evang 2=ml 3=bp 4=catholic 5=other 6=none
recode Q76 (1=7) (2=4) (3=7) (4=5) (5=5) (6=5) (7=5) (8=5) (9=5) (10=6) (11=6) (12=6), gen(reltrad6)
*manually coding the open ended responses
gen reltrad_open= Q76_13_TEXT
gen reltrad_open_jc=.
replace reltrad6=var249 if reltrad6==13 /*then repeat the sorting above to get the recoded open ended responses sorted*/
*sorting protestants into their places
replace reltrad6=3 if reltrad6==7 & black01==1 /*black protestants*/
replace reltrad6=1 if reltrad6==7 & Q75==1 /*creating evangelicals*/
replace reltrad6=2 if reltrad6==7
*used Layman and Green (2005) if there were questions about specific denominations mentioned

***************************************************************************************
***************************************************************************************
***********************STEP 2: GENERATING WEIGHTS**************************************
***************************************************************************************
***************************************************************************************	

recode Q66 (1=0) (2=1) (3=.) (4=.) (5=.) (6=.) (7=.), gen(sexweight)
recode Q72 (1=0) (2=2) (3=1) (4=3) (5=4) (6=4) (7=4), gen(raceweight)
recode Q79 (1=0) (2=0) (3=1) (4=1) (5=1) (6=2) (7=2), gen(pidweight)
recode Q78 (1=0) (2=0) (3=1) (4=1) (5=1) (6=2) (7=2), gen(ideoweight)

ipfweight sexweight raceweight Q75 pidweight ideoweight, gen(weight) val(48 52 63 12 16 6 3 29 71 32 46 22 28 39 33) maxit(100)
svyset [pweight= weight]

*/

********************************************************
********************************************************
*********************MAIN ANALYSIS**********************
********************************************************
********************************************************

**Table 1
tab party01
tab ideo01
tab female201
tab raceweight
tab reltrad6
tab income01
tab followpol01
tab discusspol01

svy: tab party01
svy: tab ideo01
svy: tab female201
svy: tab raceweight
svy: tab reltrad6
svy: tab income01
svy: tab followpol01
svy: tab discusspol01

**Table 2
summ Q43 Q44
ttesti 764    3.077225    1.608645  766    3.084856    1.593895

**Table 3: Symbolic Racism & Kaepernick Crosstab
svy: tab kaepfeel symracism4cat, col 

**Table 4: Authoritarianism & Kaepernick Crosstab
svy: tab kaepfeel auth_scale01, col

**Table 5: Multinomial Logistic Regression Results
eststo: mlogit kaepfeel party01 ideo01 black01 hispanic01 raceother01 auth_scale01 symracism i.kaeptreat [pweight= weight], baseoutcome(3)
eststo: mlogit kaepfeel party01 ideo01 black01 hispanic01 raceother01 auth_scale01 symracism i.kaeptreat c.auth_scale01#i.kaeptreat c.symracism#i.kaeptreat [pweight= weight], baseoutcome(3)
esttab , replace b(%10.3f) r2 ar2 pr2 se nogaps unstack nobaselevels noomitted

**Fig 1
quietly mlogit kaepfeel party01 ideo01 black01 hispanic01 raceother01 auth_scale01 symracism i.kaeptreat [pweight= weight], baseoutcome(3)
margins, at(symracism==(0(.125)1)) predict(outcome(1)) level(95)
marginsplot, name(kaepracismsa1) plotopts(mcolor(black)) ciopts(lcolor(black))  scheme(s1mono) title("Strong Approval") xtitle("<-Low Racial Resentment                                            High Racial Resentment->")  ytitle("Probability of Strong Approval") ylabel (, grid) 
margins, at(symracism==(0(.125)1)) predict(outcome(5)) level(95)
marginsplot, name(kaepracismsd1) plotopts(mcolor(black)) ciopts(lcolor(black))  scheme(s1mono) title("Strong Disapproval") xtitle("<-Low Racial Resentment                                            High Racial Resentment->")  ytitle("Probability of Strong Disapproval") ylabel (, grid) 
graph combine kaepracismsa1 kaepracismsd1, cols(2) altshrink
*Note: We adjusted these graphs for visual appearance using Stata's graphic editor

**Fig 2
quietly mlogit kaepfeel party01 ideo01 black01 hispanic01 raceother01 auth_scale01 symracism i.kaeptreat [pweight= weight], baseoutcome(3)
margins, at(auth_scale01==(0(.2)1)) predict(outcome(1)) level(95)
marginsplot, name(kaepauthsa) plotopts(mcolor(black)) ciopts(lcolor(black))  scheme(s1mono) title("Strong Approval") xtitle("<-Less Authoritarian                                            More Authoritarian->")  ytitle("Probability of Strong Approval") ylabel (, grid) 
margins, at(auth_scale01==(0(.2)1)) predict(outcome(5)) level(95)
marginsplot, name(kaepauthsd) plotopts(mcolor(black)) ciopts(lcolor(black))  scheme(s1mono) title("Strong Disapproval") xtitle("<-Less Authoritarian                                            More Authoritarian->")  ytitle("Probability of Strong Disapproval") ylabel (, grid) 
graph combine kaepauthsa kaepauthsd, cols(2) altshrink

********************************************************
********************************************************
*********Analysis in Footnotes**************************
********************************************************
********************************************************

*Footnote 2
factor workup01 generations01 deserve01 tryharder01, pcf
alpha workup01 generations01 deserve01 tryharder01

*Footnote 3
factor auth1 auth2 auth3 auth4 auth5, pcf
alpha auth1 auth2 auth3 auth4 auth5

*Footnote 4
*Testing the parallel regression assumption
ologit kaepfeel party01 ideo01 black01 hispanic01 raceother01 auth_scale01 symracism i.kaeptreat 
brant
**IIA test
mlogit kaepfeel party01 ideo01 black01 hispanic01 raceother01 auth_scale01 symracism i.kaeptreat, baseoutcome(3)
set seed 07141987 /*seed is the coding author's birthday as a pseudo-objective way of setting it */
mlogtest, hausman 
mlogtest, smhsiao

*Footnote 7
mlogit kaepfeel party01 ideo01 income01 female201 black01 hispanic01 raceother01 auth_scale01 symracism kaeptreat, baseoutcome(3)
mlogtest, lr

mlogit kaepfeel party01 ideo01 black01 hispanic01 raceother01 auth_scale01 symracism kaeptreat, baseoutcome(3)
mlogtest, lrcombine

mlogit kaepfeel party01 ideo01 black01 hispanic01 raceother01 auth_scale01 symracism kaeptreat, baseoutcome(3)
mlogitgof

collin kaepfeel party01 ideo01 black01 hispanic01 raceother01 auth_scale01 symracism kaeptreat
collin kaepfeel party01 ideo01 black01 hispanic01 raceother01 auth_scale01 symracism kaeptreat authXtreat symracismXtreat


********************************************************
********************************************************
*********Appendix: Robustness Checks********************
********************************************************
********************************************************

**Appendix A: Question Wording
*No quantitative analysis here

**Appendix B: Ordered Logit Results
eststo: ologit kaepfeel party01 ideo01 black01 hispanic01 raceother01 auth_scale01 symracism i.kaeptreat [pweight= weight]
eststo: ologit kaepfeel party01 ideo01 black01 hispanic01 raceother01 auth_scale01 symracism i.kaeptreat c.auth_scale01#i.kaeptreat c.symracism#i.kaeptreat [pweight= weight]
esttab , replace b(%10.3f) r2 ar2 se nogaps

**Appendix C: Principal Components Analysis
factor workup01 generations01 deserve01 tryharder01 auth1 auth2 auth3 auth4 auth5, pcf

**Appendix D: Additional Details on Alternative Wording Experiment
eststo: reg kaepfeel kaeptreat [pweight= weight]
eststo: ologit kaepfeel kaeptreat [pweight= weight]
esttab , replace b(%10.3f) r2 ar2 se nogaps

**Appendix E: Multinomial Logistic Regression Results (No Controls)
eststo: ologit kaepfeel auth_scale01 i.kaeptreat [pweight= weight]
eststo: ologit kaepfeel symracism i.kaeptreat  [pweight= weight]
esttab , replace b(%10.3f) r2 ar2 pr2 se nogaps nobaselevels noomitted

eststo: mlogit kaepfeel auth_scale01 i.kaeptreat [pweight= weight], baseoutcome(3)
eststo: mlogit kaepfeel symracism i.kaeptreat  [pweight= weight], baseoutcome(3)
esttab , replace b(%10.3f) r2 ar2 pr2 se nogaps unstack nobaselevels noomitted

**Appendix F: Mlogit Substantive Size

**Fig F1
mlogit kaepfeel party01 ideo01 black01 hispanic01 raceother01 auth_scale01 symracism i.kaeptreat c.auth_scale01#i.kaeptreat c.symracism#i.kaeptreat [pweight= weight], baseoutcome(3)
margins, at(kaeptreat==0 symracism==(0(.125)1)) at(kaeptreat==1 symracism==(0(.125)1)) predict(outcome(1)) level(95)
marginsplot, name(kaepracismsa3) plotopts(mcolor(black)) ciopts(lcolor(black))  scheme(s1mono) title("Strongly Approve") xtitle("<-Lowest Symbolic Racism         Highest Symbolic Racism->")  ytitle("Probability of Strong Approval") ylabel (, grid) 
margins, at(kaeptreat==0 symracism==(0(.125)1)) at(kaeptreat==1 symracism==(0(.125)1)) predict(outcome(5)) level(95)
marginsplot, name(kaepracismsd3) plotopts(mcolor(black)) ciopts(lcolor(black))  scheme(s1mono) title("Strongly Disapprove") xtitle("<-Lowest Symbolic Racism         Highest Symbolic Racism->")  ytitle("Probability of Strong Disapproval") ylabel (, grid) 
graph combine kaepracismsa3 kaepracismsd3, cols(2) altshrink

**Fig F2
mlogit kaepfeel party01 ideo01 black01 hispanic01 raceother01 auth_scale01 symracism i.kaeptreat c.auth_scale01#i.kaeptreat c.symracism#i.kaeptreat [pweight= weight], baseoutcome(3)
margins, at(kaeptreat==0 auth_scale01==(0(.2)1)) at(kaeptreat==1 auth_scale01==(0(.2)1)) predict(outcome(1)) level(95)
marginsplot, name(kaepauthsa3) plotopts(mcolor(black)) ciopts(lcolor(black))  scheme(s1mono) title("Strongly Approve") xtitle("<-Less Authoritarian       More Authoritarian->")  ytitle("Probability of Strong Approval") ylabel (, grid) 
margins, at(kaeptreat==0 auth_scale01==(0(.2)1)) at(kaeptreat==1 auth_scale01==(0(.2)1)) predict(outcome(5)) level(95)
marginsplot, name(kaepauthsd3) plotopts(mcolor(black)) ciopts(lcolor(black))  scheme(s1mono) title("Strongly Disapprove") xtitle("<-Less Authoritarian       More Authoritarian->")  ytitle("Probability of Strong Disapproval") ylabel (, grid) 
graph combine kaepauthsa3 kaepauthsd3, cols(2) altshrink



